package com.tvshows.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.List;

/**
 * A Show.
 */
@Document(collection = "T_SHOW")
public class Show implements Serializable {

    @Id
    private String id;

    @Field("name")
    private String name;

    @Field("season_number")
    private Integer seasonNumber;

    @Field("last_episode_number")
    private Integer lastEpisodeNumber;

    @Field("schedule")
    private String schedule;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSeasonNumber() {
        return seasonNumber;
    }

    public void setSeasonNumber(Integer seasonNumber) {
        this.seasonNumber = seasonNumber;
    }

    public Integer getLastEpisodeNumber() {
        return lastEpisodeNumber;
    }

    public void setLastEpisodeNumber(Integer lastEpisodeNumber) {
        this.lastEpisodeNumber = lastEpisodeNumber;
    }

    public String getSchedule() {
        return schedule;
    }

    public void setSchedule(String schedule) {
        this.schedule = schedule;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Show show = (Show) o;

        if (id != null ? !id.equals(show.id) : show.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "Show{" +
            "id=" + id +
            ", name='" + name + "'" +
            ", seasonNumber='" + seasonNumber + "'" +
            ", lastEpisodeNumber='" + lastEpisodeNumber + "'" +
            ", schedule='" + schedule + "'" +
            '}';
    }
}
